package cn.iocoder.yudao.module.pickbook.dal.mysql.classmember;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.pickbook.dal.dataobject.classmember.ClassMemberDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.pickbook.controller.admin.classmember.vo.*;

/**
 * 班级成员 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface ClassMemberMapper extends BaseMapperX<ClassMemberDO> {

    default PageResult<ClassMemberDO> selectPage(ClassMemberPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ClassMemberDO>()
                .eqIfPresent(ClassMemberDO::getClassId, reqVO.getClassId())
                .eqIfPresent(ClassMemberDO::getUserId, reqVO.getUserId())
                .eqIfPresent(ClassMemberDO::getStatus, reqVO.getStatus())
                .orderByDesc(ClassMemberDO::getId));
    }

}